package API_sample
{
	import flash.display.Sprite;
	import flash.net.registerClassAlias;
	import flash.utils.ByteArray;
	import flash.utils.getDefinitionByName;
	import flash.utils.getQualifiedClassName;

	public class ByteArray_sample extends Sprite
	{ 
		private var ba:ByteArray = new ByteArray();
		public function ByteArray_sample()
		{
			var i:int = 1000;
			
			var b:ByteArray = new ByteArray();
			
			writeBoolean(true);
			writeByte(1);
			
			switch()
			{
				case 1:
					
			}
		}
		
		private function writeBoolean(boolean:Boolean):void
		{
			ba.writeBoolean(boolean);
			print();
		}
		
		private function writeByte(i:int):void
		{
			ba.writeByte(i);
			print();
		}
		
		private function writeBytes():void
		{
			//ba.writeBytes(
		}
		
		private function print():void
		{
			trace("bytesAvailable:"+ba.bytesAvailable);
			trace("endian:"+ba.endian);
			trace("length:"+ba.length);
			trace("objectEncoding:"+ba.objectEncoding);
			trace("position:"+ba.position);
		}
	}
}